package com.ssy.lingxi.member.merchant.model.vo.mobile.response;

import com.ssy.lingxi.member.merchant.model.constant.MobileApplyButtonStatusEnum;
import org.springframework.util.StringUtils;

import java.io.Serializable;

/**
 * App - “申请会员” 页面 - 查询按钮状态
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-12
 */
public class MobileInfoApplyButtonVO implements Serializable {
    private static final long serialVersionUID = 8186400743035028847L;

    public MobileInfoApplyButtonVO(MobileApplyButtonStatusEnum statusEnum) {
        this.show = statusEnum.getShow();
        this.status = statusEnum.getCode();
        this.disabled = statusEnum.getDisabled();
        this.value = statusEnum.getMsg();
        this.msg = "";
    }

    public MobileInfoApplyButtonVO(MobileApplyButtonStatusEnum statusEnum, String msg) {
        this.show = statusEnum.getShow();
        this.status = statusEnum.getCode();
        this.disabled = statusEnum.getDisabled();
        this.value = statusEnum.getMsg();
        this.msg = StringUtils.hasLength(msg) ? msg : "";
    }

    /**
     * 是否显示按钮
     */
    private Boolean show;

    /**
     * 是否禁用按钮
     */
    private Boolean disabled;

    /**
     * 状态枚举：0-正常（可申请），1-入库审核中，2-审核通过，3-审核不通过，4-黑名称，5-淘汰, 6-冻结，7-不显示按钮，8-会员进入自己店铺时，显示但禁用按钮
     */
    private Integer status;

    /**
     * “申请成为会员”按钮的文字
     */
    private String value;

    /**
     * 入库审核不通过的原因，当status=3时不为空
     */
    private String msg;

    public Boolean getShow() {
        return show;
    }

    public void setShow(Boolean show) {
        this.show = show;
    }

    public Boolean getDisabled() {
        return disabled;
    }

    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
